package com.hongmeng.teamwork.service.impl;

import com.hongmeng.teamwork.entity.po.TeamworkProjectGroupRel;
import com.hongmeng.teamwork.mapper.TeamworkProjectGroupRelMapper;
import com.hongmeng.teamwork.service.ITeamworkProjectGroupRelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (HongmengTeamworkProjectGroupRel)表服务实现类
 *
 * @author makejava
 * @since 2023-11-17 13:53:05
 */
@Service("hongmengTeamworkProjectGroupRelService")
public class ITeamworkProjectGroupRelServiceImpl implements ITeamworkProjectGroupRelService {

    @Resource
    private TeamworkProjectGroupRelMapper teamworkProjectGroupRelMapper;

    /**
     * 通过ID查询单条数据
     *
     * @return 实例对象
     */
    @Override
    public TeamworkProjectGroupRel queryByProjectId(Long projectId) {
        return this.teamworkProjectGroupRelMapper.queryByProjectId(projectId);
    }

    @Override
    public List<TeamworkProjectGroupRel> queryByCondition(TeamworkProjectGroupRel teamworkProjectGroupRel) {
        return this.teamworkProjectGroupRelMapper.queryByCondition(teamworkProjectGroupRel);
    }

    /**
     * 新增数据
     *
     * @param teamworkProjectGroupRel 实例对象
     * @return 实例对象
     */
    @Override
    public boolean insert(TeamworkProjectGroupRel teamworkProjectGroupRel) {
        return this.teamworkProjectGroupRelMapper.insert(teamworkProjectGroupRel) > 0;
    }

    @Override
    public boolean deleteByProjectId(Long projectId) {
        return this.teamworkProjectGroupRelMapper.deleteByProjectId(projectId) > 0;
    }
}
